import os
from PIL import Image

path = 'images' 
out_path = 'output'
logo = Image.open('logo.png')
for filename in os.listdir(path): 
    image = Image.open(path + '/' + filename)
    simg = image.resize((800, 800))
    x = simg.width - logo.width - 5
    y = simg.height - logo.height - 5
    simg.paste(logo, (x, y))
    simg.save(out_path + '/' + filename)
    